package com.example.service.impl;


import com.example.mapper.BookMapper;
import com.example.pojo.Book;
import com.example.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author luqi
 * @Date 2025 06 19 09 21
 **/


@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookMapper bookMapper;

    @Override
    public boolean SaveNewBook(Book book) {
        return bookMapper.SaveNewBook(book) > 0;
    }

    @Override
    public boolean DeleteBookById(Integer id) {
        return bookMapper.DeleteBookById(id) > 0;
    }

    @Override
    public boolean UpdateBookInformation(Book book) {
        return bookMapper.UpdateBookInformation(book) > 0;
    }

    @Override
    public Book SearchBookById(Integer id) {
        return bookMapper.SearchBookById(id);
    }

    @Override
    public List<Book> SearchAllBook() {
        return bookMapper.SearchAllBook();
    }
}
